package com.robot.mvvm.vm.main

import android.app.Application
import com.blankj.utilcode.util.StringUtils
import com.robot.base.base.vm.GLBaseViewModel
import com.robot.base.model.ImageTextBean
import com.robot.mvvm.R
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent

class WorkBenchFragmentViewModel(application: Application) : GLBaseViewModel(application) {

    val uc = UiChangeEvent()

    class UiChangeEvent {
        val serveDataEvent = SingleLiveEvent<List<ImageTextBean>>()
        val deviceDataEvent = SingleLiveEvent<List<ImageTextBean>>()
    }

    fun initData() {
        val deviceList = arrayListOf<ImageTextBean>()
        val serveList = arrayListOf<ImageTextBean>()

        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_1,
                StringUtils.getString(R.string.app_tips_41)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_2,
                StringUtils.getString(R.string.app_tips_42)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_3,
                StringUtils.getString(R.string.app_tips_20)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_4,
                StringUtils.getString(R.string.app_tips_22)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_5,
                StringUtils.getString(R.string.app_tips_43)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_6,
                StringUtils.getString(R.string.app_tips_44)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_7,
                StringUtils.getString(R.string.app_tips_23)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_8,
                StringUtils.getString(R.string.app_tips_45)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_9,
                StringUtils.getString(R.string.app_tips_46)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_10,
                StringUtils.getString(R.string.app_tips_47)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_11,
                StringUtils.getString(R.string.app_tips_48)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_12,
                StringUtils.getString(R.string.app_tips_49)
            )
        )
        serveList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_13,
                StringUtils.getString(R.string.app_tips_50)
            )
        )
        uc.serveDataEvent.postValue(serveList)

        deviceList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_14,
                StringUtils.getString(R.string.app_main_menu_1)
            )
        )
        deviceList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_15,
                StringUtils.getString(R.string.app_tips_18)
            )
        )
        deviceList.add(
            ImageTextBean(
                R.mipmap.app_ic_work_bench_16,
                StringUtils.getString(R.string.app_tips_21)
            )
        )
        uc.deviceDataEvent.postValue(deviceList)
    }
}